<template>

	<view class="page">

		<view class="notice">	
				<view class="noticeText">
          <text class ="notice1">
          位于四川省成都市郫都区德源镇东林艺术村，是全国唯一经袁隆平院士授权以其名字命名的园区。
					全国首批科学家精神教育基地，园区以袁隆平院士为精神支柱，以稻蒜文化为基础，将科研场景
					变成教学场景，建立劳动教育、农业科普教育基地及成人实训基地。
        </text>
		</view >
		</view>
		<view class="bookingContent">
			<view class="booking" >
				<navigator url="/pages/visitorNotice/visitorNotice">
					<image class="navPng" src="../../static/1.png" mode=""></image>
					<text class="navText">个人预约</text>
					<text class="navSubText">Personal reservation</text>
				</navigator>
			</view>
      </view>

			<view class="booking" @click="goBook2">
				<navigator url="/pages/visitorNotice/visitorNotice1">
					<image class="navPng" src="../../static/2.png" mode=""></image>
					<text class="navText"> 团队预约</text>
					<text class="navSubText">Group reservation</text>
				</navigator>
			</view>

			<view class="booking"  @click="navigateToInfoPage">
				  <image class="navPng" src="../../static/3.png" mode=""></image>
				  <text class="navText"> 扫码入园</text>
				  <text class="navSubText">Scan the QR code to enter the park</text>
			</view>
		</view>

</template>



<script>
export default {
  data() {
    return {
      userInfo: {}
    };
  },
  onLoad() {
    console.log('onLoad')
    // uni.getStorageSync({
    // 	key: 'userData',
    // 	success: (res) => {
    // 		this.userInfo = JSON.parse(res.data);
    // 		console.log(this.userInfo.userInfoType )
    // 		console.log(this.userInfo.userInfoType ==='person')
    // 	}
    // });
  },
  onShow(){
    console.log('show')
    // uni.getStorageSync()
    uni.getStorage({
      key: 'userData',
      success: (res) => {
        this.userInfo = JSON.parse(res.data);
        console.log(this.userInfo.userInfoType )
        console.log(this.userInfo.userInfoType ==='person')
      }
    });
    // console.log(this.userInfo.userInfoType)
  },
  computed: {
    userInfoType() {
      return this.userInfo.userInfoType;
    }
  },

  methods: {
    navigateToInfoPage() {
      console.log(this.userInfo.userInfoType)
      if (this.userInfo.userInfoType === "person") {
        uni.navigateTo({
          url: "/pages/ScanQRPersonal/ScanQRPersonal"
        })
      } else {
        uni.navigateTo({
          url: "/pages/ScanQR/ScanQR"

        });
      }
    }
  }
};
</script>


<style>
	.page {

		position: inherit;
		background-image: url('../../static/bg_full.png');
		border-radius: 12px;
		padding-top: 200rpx;
    width: 100%;
    height: 600px;
    background-size: cover;
    background-repeat: no-repeat
	}

	.notice {
		width: 600rpx;
		height: 400rpx;
		font-family: PingFangSC-Regular;
		font-size: 12rpx;
		color: #05261B;
		letter-spacing: 0;
		line-height: 21px;
		background: #FFFFFF;
		background-color: transparent;
		border-radius: 12px;
		margin-bottom: 80rpx;
		margin-left: 90rpx;
		margin-top: 30rpx;
	}

    .noticeText{
      width: 300px;
      height: 126px;
      margin-top: 60rpx;
    }

  .notice1{
    width: 259px;
    height: 126px;
    font-family: PingFangSC-Regular;
    font-weight: 400;
    font-size: 10px;
    color: #05261B;
    letter-spacing: 0;
    line-height: 21px;
    margin-left: 100rpx;
  }

    .bookingContent{
      margin-top: 20%;
    }

	.booking {
		width: 630rpx;
		height: 140rpx;
		background: #FFFFFF;
		border-radius: 12px;
		margin-top: 28rpx;
		margin-bottom: 30rpx;
		margin-left: 60rpx;
		margin-right: 60rpx;
	}


	.navText {
		width: 61.48px;
		height: 21px;
		font-family: PingFangSC-Medium;
		font-weight: 500;
		font-size: 15px;
		font-weight: bold;
		color: #05261B;
		letter-spacing: 0;
		vertical-align: middle;
		margin-top: 35rpx;
		float: left;
	}

	.navSubText {
		width: 210px;
		height: 17px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 12px;
		color: #5F5F5F;
		letter-spacing: 0;
		margin-top: 80rpx;
		margin-left: -118rpx;
		float: left;
	}

	.navPng {
		width: 64rpx;
		height: 64rpx;
		margin-left: 30rpx;
		margin-top: 40rpx;
		vertical-align: middle;
		margin-right: 30rpx;
		float: left;
	}
	.tipPng{
		width:420rpx;
		height: 188rpx;
		margin-left: 30rpx;
		margin-top: 10rpx;
		vertical-align: middle;
		float: right;
	}

</style>